package net.pulseproject.commons.util;

import java.util.Random;

//FIXME delete, as its a duplicate of josceleton version
public final class RandomUtil {
	
	private static final Random R = new Random();
	
	private RandomUtil() {
		// util class should not be instantiable
	}

	public static int randFromZeroToExclusive(final int exclusiveMax) {
		return R.nextInt(exclusiveMax);
	}
	
	public static int generateWithinRange(final int middle, final int deviation) {
		final int start = middle - deviation;
		final int randMax = deviation * 2 + 1;
		final int randValue = RandomUtil.R.nextInt(randMax);
		return start + randValue;
	}
}
